const axios = require('axios')
export default {
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: 'doApis',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
			{name:'bytedance-verification-code',content:'Q7CARU8mJX/yZOrHyoNL'},
      { name : '360-site-verification',content :'a83ae59d64bd49b10433005e38bc4ccd'}
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ],
    script:[
      { src : 'https://hm.baidu.com/hm.js?7a1048faa3a04c4305f00e2f2fbb49e5' },
    ]
  },
  loading: {
    color: '#1890FF', height: '2px'
  },
	
  target: 'server',
  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: [],

  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    {src:'@/plugins/antd-ui',ssr:true},
    '@/plugins/highlight',
    '@/plugins/axios'
  ],

  // Auto import components (https://go.nuxtjs.dev/config-components)
  components: true,

  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [
  ],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    'cookie-universal-nuxt',
    ['nuxt-highlightjs', {style: 'atom-one-dark'}],  //paraiso-light solarized-light atom-one-dark
    '@nuxtjs/sitemap'
  ],
  
  // Axios module configuration (https://go.nuxtjs.dev/config-axios)
  //axios: {},

  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {
    transpile: ["ant-design-vue"],
      babel: {
        plugins: [
          [
            "import",
            {
              libraryName: "ant-design-vue",
              libraryDirectory: "es",
              style: "css" // 如果需要使用 less 方式去按需加载的话，则需要改为 true ，并且添加下面loaders 配置
            },
            "ant-design-vue"
          ]
        ]
      },
    //parallel:true,	
    //cache:true,
    parallel:true,
    extractCSS: { allChunks: true }
  },

  router: { 
    mode: 'history', 
  },
  sitemap:{
    path: '/sitemap.xml',
    hostname: 'https://www.doapis.com/',
    cacheTime: 1000 * 60 * 60 * 24,
    gzip: true,
    generate: false, 
    exclude: ['/404'],
    routes: async () => {
      const routes = await axios.get('https://www.doapis.com/doapis/web/getSitemap');
      return routes.data	
    }
  },
	/**
	generate: {
		routes:[
			'/list/1',
			'/list/2',
			'/list/3',
		]
	}
	**/
  server: {
		port: 3000,
		host: 'localhost', // default: localhost 0.0.0.0
	}	  
}
